home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / clip_art / _cdview / cdview (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1997-12-18  |  17.4 KB  |  557 lines

  1.  --> CD Catalogue
  2.  This program and all documentation 
  3.  David Holden 1995
  4. A_$="1.40":
  5. 262343,D_%,E_%
  6. G_%:A%=1:B%=E_%:G%=H_%:H%=I_%:
  7. 262341,,E_%
  8. 262351,,L_%+100:
  9. L_%?108=4
  10. :E_%!100=K_%:
  11. 262342,,E_%+100:M_%=N_%:O_%=P_%:Q_$=$R_%
  12. 262342,,E_%:I%=
  13. T_(0)
  14. 262342,,E_%:E_%!4=0:
  15. 262340,,E_%:I%=
  16. T_(0)
  17. 262342,,E_%
  18. W_(X_%,Y_%)
  19. 262364,E_%!24
  20. 17,18:
  21. E_%!16
  22. 262351,,E_%+&C0:d_%=E_%!&C8:e_%=E_%!&C4:
  23. E_%!4=-1
  24. 0:!E_%=G_%:
  25. 262342,,E_%:!E_%=U_%:
  26. 262342,,E_%:$f_%="CDview Help":
  27. g_(h_$+".!Help")
  28. d_%=1
  29. 262356,,i_%,j_%,k_%
  30. l_%,m_%:j_%=!E_%:e_%=E_%!4:d_%=E_%!8:m_%=E_%!12:l_%=E_%!16:
  31. l_%=n_%
  32. 1:P_%=O_%:N_%=M_%:$R_%=Q_$:
  33. o_(P_%)
  34. 2:k_%=228:
  35. 262356,,i_%,j_%-60,k_%
  36. 4:P_%=p_%+1:N_%=48:
  37. $(p_%+4)=".^" $R_%=h_$+".^"
  38. $R_%=$(p_%+4)
  39. o_(P_%)
  40. 263872:
  41. q_(l_%)
  42. 64,16:J%=
  43. r_(l_%,P_%):I%=J%+2:
  44. ?I%<33:I%+=1:
  45. :s_$=$R_%+"."+$I%:
  46. t_(K_%,l_%,J%)
  47. &416,&404:I%=
  48. r_(l_%,P_%)+2:
  49. ?I%<33:I%+=1:
  50. :s_$=$R_%+"."+$I%
  51. 263873
  52. N_%=48
  53. 263872:A%=4:B%=P_%:C%=N_%:P_%=
  54. (J_%):N_%=P_%?1:I%=R_%+
  55. ($R_%):
  56. ?I%<>46:I%-=1:
  57. :?I%=13:
  58. o_(P_%):
  59. 263873:
  60. r_(i%,p%):
  61. u_%:u_%=i%:p%=
  62. v_(p%):
  63. u_%>0:
  64. ?p%<>N_%:p%=
  65. v_(p%):
  66. v_(p%)
  67. v_(p%)
  68. :u_%-=1:
  69. q_(i%):
  70. w_%,u_%,x%,y%,x_%:
  71. r_(i%,P_%):
  72. ">":P_%=w_%:N_%+=1:w_%+=3:
  73. ?w_%<32:w_%+=1:
  74. :$R_%=$R_%+"."+$w_%:
  75. o_(P_%)
  76. y_(K_%,i%,0):I%=w_%+2:
  77. ?I%<33:I%+=1:
  78. :$f_%=$I%:s_$=$R_%+"."+$f_%:!E_%=G_%:
  79. 262342,,E_%:!E_%=U_%:
  80. 262342,,E_%:I%=
  81. T_(0):
  82. ?w_%<>
  83. !z_%=U_%:
  84. 262348,,z_%:$(z_%!76)=$f_%:
  85. 53,-1,11
  86. ,,x%:
  87. 53,-1,4
  88. ,,x_%:x%=x%<<x_%:
  89. 53,-1,12
  90. ,,y%:
  91. 53,-1,5
  92. ,,x_%:y%=y%<<x_%:!E_%=0:E_%!4=-(y%-40):E_%!8=x%-32:E_%!12=0:
  93. 262359,U_%,E_%
  94. __(&D94,s_$)
  95. g_(s_$)
  96. __(&AFF,s_$)
  97. __(&FF9,s_$)
  98. o_(p%):
  99. `_%,A`%,a$:`_%=-20:A`%=0:
  100. p%?2=
  101. "x" B`%=
  102. 263872:!z_%=K_%:
  103. 262348,,z_%:I%=z_%!88:
  104. I%>=0:!L_%=K_%:L_%!4=I%-1:
  105. 262340,,L_%:I%-=1:
  106. :I%=R_%+
  107. ($R_%):
  108. ?I%<>46:I%-=1:
  109. :I%+=1:a$=$I%:
  110. a$="^" a$="$"
  111. U$(z_%!76)=a$:p%=
  112. v_(p%):
  113. 4:L_%!(I%+4)=C`%!I%:
  114. :!L_%=K_%:
  115. ?p%>=N_%:
  116. p%?1=N_%+1
  117. D`(E`%,p%+2)
  118. :A%=3:B%=p%:C%=N_%:p%=
  119. (J_%)
  120. D`(E`%+64,p%+1):p%=
  121. v_(p%)
  122. D`(E`%+16,p%+1):p%=
  123. v_(p%)
  124. D`(E`%+32,p%+1):p%=
  125. v_(p%)
  126. D`(E`%+48,p%+1):p%=
  127. v_(p%)
  128. v_(p%)
  129. :`_%=-(A`%
  130. 2+A`%
  131. 2)*40-20:
  132. `_%>F`% `_%=F`%
  133. !L_%=0:L_%!4=`_%:L_%!8=274:L_%!12=0:
  134. 262359,K_%,L_%:!z_%=K_%:
  135. 262348,,z_%+1:z_%!24=0:z_%!28=-1:
  136. 262341,,z_%:
  137. 262353,-1,z_%!4,z_%!8,z_%!12,z_%!16+40:
  138. 263873:
  139. D`(i%,p%):
  140. ?p%<32
  141. ?p%=120:p%+=1:
  142. :L_%!24=p%:L_%!28=i%:
  143. 262338,,L_%:
  144. L_%!4>200
  145. >L_%!8=L_%!8-40:L_%!16=L_%!16-40:L_%!4=8:L_%!12=272:`_%-=40
  146. :L_%!4=276:L_%!12=542
  147. :A`%+=1:
  148. 8,17,h_$+".Cat_File"
  149. F%,,,,I_%:
  150. 1)<>1 I%=
  151. H`(1,"No catalogue data found - unable to continue"):
  152. I`% I_%+&20:
  153. 8,16,h_$+".Cat_File",I`%,0:A%=0:B%=I`%:C%=I_%:
  154. J_%:J`$=$I`%:p_%=
  155. v_(I`%):P_%=p_%+1:O_%=P_%:N_%=48:M_%=N_%:B`%=
  156. $(p_%+4)=".^" $R_%=h_$+".^"
  157. $R_%=$(p_%+4)
  158. MQ_$=$R_%:!E_%=K_%:
  159. 262347,,E_%:F`%=E_%!8-E_%!16:
  160. o_(P_%):
  161. 262341,,E_%:
  162. t_(w%,i%,p%):
  163. x%,y%:X_%=w%:Y_%=i%:
  164. 262351,,L_%:x%=!L_%-18:y%=L_%!4-9:!L_%=w%:L_%!4=i%:
  165. 262350,,L_%:!L_%=x%:L_%!4=y%:L_%!8=x%+36:L_%!12=y%+18:
  166. 271360,%11000101,1,"file_d94",L_%
  167. 271360,%11000101,1,"file_aff",L_%
  168. 271360,%11000101,1,"file_ff8",L_%
  169. 271360,%11000101,1,"file_fff",L_%
  170. 271360,%11000101,1,"directory",L_%
  171. W_(w%,i%):
  172. 271361:K`%=0:L_%!&80=w%:L_%!&84=i%:
  173. 262350,,L_%+&80:I%=(L_%!&9C):
  174. $(I%),"."):I%+=1:
  175. :f_$=$(I%):
  176. 262351,,L_%:L_%!20=L_%!12:L_%!24=L_%!16:L_%!28=!L_%:L_%!32=L_%!4:L_%!16=1:$(L_%+44)=f_$
  177. @!L_%=(
  178. (f_$)+49)
  179. 3:L_%!12=0:
  180. 262375,17,L_%,L_%!20,L_%!24:
  181. f$,d$,i$,i%,L`%:
  182. "Closearchive cd_dir_arc":
  183. :i%=E_%+44:
  184. ?i%>31:i%+=1:
  185. ?i%<>46:i%-=1:
  186. :?i%=13:d$=$(E_%+44):$L_%=s_$:i%=L_%+
  187. ?i%<>46:i%-=1:
  188. :?i%=13:f$=$L_%:!z_%=K_%:
  189. 262348,,z_%:i%=z_%!88:
  190. i%>=0:
  191. N`(K_%,i%)=
  192. i$="."+
  193. O`(K_%,i%):
  194. 5,"openarchive "+$R_%+" cd_dir_arc":f$="arcfs#cd_dir_arc:$":M`%=
  195. 8,5,f$+i$
  196. ,,L`%,,I_%:L`%=(L`%>>8)
  197. &FFF:
  198. L`%=&3FB
  199. I_%<&C000
  200. 5,"openarchive "+f$+i$+" cd_dir_arc":f$="arcfs#cd_dir_arc:$":M`%=
  201. "copy "+f$+i$+" "+d$+i$+" RQ~V~C":
  202. "Closearchive cd_dir_arc":M`%=
  203. y_(K_%,i%,0)
  204. :i%-=1:
  205. y_(w%,i%,s%):!L_%=w%:L_%!4=i%:L_%!8=s%<<21:L_%!12=1<<21:
  206. 262349,,L_%:
  207. O`(w%,i%):!L_%=w%:L_%!4=i%:
  208. 262350,,L_%:I%=(L_%!28):
  209. ?I%>31:I%+=1:
  210. :?I%=13:=$(L_%!28)
  211. N`(w%,i%):!L_%=w%:L_%!4=i%:
  212. 262350,,L_%:
  213. (L_%!24
  214. 1<<21):=
  215. T_(P`%):
  216. 262380,Q`%+P`%,-1
  217. e%>=(Q`%+P`%):=
  218. 262380,Q`%,-1:=
  219. S`,T`,U`,V`,m%:T`=1:S`=2:V`=4:U`=&80:
  220. W`%&200:m%=W`%:i_%=
  221. X`(m%,"CDview",180):m%=
  222. Y`("Help",0,0):m%=
  223. Y`("Info",0,Z`%):m%=
  224. Y`("Quit",U`,0):
  225. X` (a%,a`$,b`%):$a%=a`$:a%!12=&70207:a%!16=b`%:a%!20=40:a%!24=0:m%=a%+28:=a%
  226. Y` (c`$,d`%,e`%):!m%=d`%:m%!4=e`%:m%!8=&7000001:$(m%+12)=c`$:=m%+24
  227. f` (g`$,h`%,i`$):
  228. j`% 24:$j`%="s!"+g`$:$(j`%+16)=i`$:!E_%=h`%:E_%!4=0:E_%!8=-24:E_%!12=80:E_%!16=80:E_%!20=&1700210B:E_%!28=j`%:E_%!24=j`%+16:E_%!32=8:
  229. 262338,,E_%
  230. I%:=I%
  231. v_(p%):
  232. :p%+=1:
  233. ?p%=10
  234. ?p%=13:=p%+1
  235. C_(k`$,l`%):
  236. 263874:D_%=&C31:!L_%=
  237. :$(L_%+4)="Error "+
  238. )+": "+k`$++
  239. 262367,L_%,1,m`%:
  240. 262365,n`%,&4B534154:
  241. H`(o`%,a$):L_%!&80=0:$(L_%+&84)=a$+
  242. 262367,L_%+&80,16
  243. o`%,m`%
  244. ,I%:=I%
  245. J_%&500:
  246. 2:P%=J_%:[OPT q`:adr r8,r`:mov r0,r0,lsl#2:ldr pc,[r8,r0]:.s` equd 0;return data at code%+12:equd 0
  247. t/.r` equd t`:equd u`:equd v`:equd w`:equd S_
  248. ; r1=ptr, r2=level, exit with r0=ptr:.w`:mov r0,r1;put ptr in r0 ready for return:.x` ldrb r1,[r0],#1;look for line beginning with 'level' charater:cmp r1,#13:cmpne r1,#10:bne x`:ldrb r1,[r0]:cmp r1,r2:bne x`
  249. e.x` ldrb r1,[r0],#1;skip the line with the level number:cmp r1,#13:cmpne r1,#10:bne x`:mov pc,r14
  250. ; r1=ptr, r2=level, exit with r0=ptr:.S_ mov r0,r1;transfer ptr to r0:.x` ldrb r1,[r0,#-1]!;look for end of prev line:cmp r1,#13:bne x`:ldrb r1,[r0,#1];get sol char:cmp r1,#62;if it's not '>' carry on:bne x`
  251. uldrb r1,[r0,#2];get char after '>':cmp r1,r2;if it's < level all done:bge x`:add r0,r0,#1;point to sol:mov pc,r14
  252. ;enter with r1 points to text, r2=length:.v` add r2,r1,r2:mov r0,#32;start with 32 in case there's no final cr:.x` ldrb r3,[r1],#1:cmp r1,r2:movgt pc,r14:cmp r3,#10:cmpne r3,#13:bne x`:ldrb r11,[r1];get char after eol
  253. Badd r11,r11,r3:cmp r11,#23:addeq r1,r1,#1:add r0,r0,#32:bal x`
  254. ;enter with r1 points to text, r2=length:.t` add r2,r1,r2:.x` ldrb r0,[r1],#1:cmp r0,#10:moveq r0,#13:streqb r0,[r1,#-1]:cmp r1,r2:blt x`:mov pc,r14
  255. ;enter with r1=blk, r6=text, r7=text length:.u` stmfd r13!,{r14}:add r7,r7,r6;r7 now = end of text:ldr r2,y`;get window handle:str r2,[r1]:swi "Wimp_RedrawWindow":.z` cmp r0,#0:ldmeqfd r13!,{pc}:ldr r0,[r1,#4]:ldr r2,[r1,#20]
  256. asub r8,r0,r2:add r8,r8,#16:ldr r0,[r1,#16]:ldr r2,[r1,#24]:sub r9,r0,r2;r9 = top of work area
  257. ldr r3,[r1,#40];get top of graphics window:sub r3,r9,r3;r3 = offset from top:mov r3,r3,lsr#5;divide by 32 = number of lines:mov r2,r3,lsl#5:sub r9,r9,r2:mov r2,r6;point to text:subs r3,r3,#1:bmi _`
  258. .`` ldrb r0,[r2],#1;count down to required line:cmp r0,#13:cmpne r0,#10:bne ``:ldrb r11,[r2];get char after eol in r11:add r11,r11,r0;add to eol char:cmp r11,#23:addeq r2,r2,#1;if sum=23 it's cr/lf so inc r2:subs r3,r3,#1
  259. bpl ``
  260. ._` ldr r4,[r1,#40];get graphics window max y:ldr r3,[r1,#32];get graphics window min y:sub r5,r4,r3;r5=height:mov r5,r5,lsr#5;divide by 5 = num lines:add r5,r5,#1;+1:sub r9,r9,#4;allow 4 points gap at top:bl Aa
  261. z.Ba cmp r2,r7:bgt Ca;at end of text:ldrb r0,[r2],#1:cmp r0,#31:swigt "OS_WriteC":bgt Ba:cmp r0,#10:cmpne r0,#13:beq Da
  262. ;check for tab here
  263. bal Ba
  264. .Da ldr r11,[r2];get char after eol in r11:add r11,r11,r0;add to eol char:cmp r11,#23:addeq r2,r2,#1;if sum=23 it's cr/lf so inc r2:subs r5,r5,#1;dec line count:bmi Ca;graphics window redrawn, get next
  265. bsub r9,r9,#32;move down a line:bl Aa:bal Ba;print next line:.Ca swi "Wimp_GetRectangle":bal z`
  266. .Aa swi 256+25:swi 256+4:mov r0,r8:swi "OS_WriteC":mov r0,r0,lsr#8:swi "OS_WriteC":mov r0,r9:swi "OS_WriteC":mov r0,r0,lsr#8:swi "OS_WriteC":movs pc,r14
  267. .y` equd G_%
  268. .Ea% equd 0:.Fa% equd 0:.Ga% equd 0:.Ha% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ia% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ja% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0
  269. equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ka% equd 0:.La% equd 0:.Ma% equd 0:.Na% equd-1:.Oa% equd 0:.Pa% equd 0:.Qa% equd 0:.Ra% equd 0:.Sa% equd 0:.Ta% equd 255
  270. :<equs "Unable to resize block for ArtWorks!":equb 0:align
  271. .Ua cmp r11,#0:stmfd r13!,{r4-r8,r14}:andne r5,r15,#(%1101<<28):teqnep r15,r5:ldmnefd r13!,{r4-r8,pc}:mov r1,#0:sub r1,r1,#1:cmp r0,r1:beq Va:ldmltfd r13!,{r4-r8,pc}:.Wa str r0,Ea%:ldr r3,La%:sub r3,r3,#&8000:add r3,r3,r0
  272. mov r0,r3:swi "Wimp_SlotSize":cmp r3,r0:bgt Xa:ldr r0,La%:ldr r1,Ea%:str r1,Ma%:ldr r2,Na%:ldr r3,Oa%:and r5,r15,#(%111<<29):
  273.  make sure V is clear
  274. teqp r15,r5:ldmfd r13!,{r4-r8,pc}:.Xa:adr r0,Ta%:orr r5,r15,#1<<28:teqp r15,r5:ldmfd r13!,{r4-r8,pc}:.Va:ldr r0,La%:ldr r1,Ma%:ldr r2,Na%:ldr r3,Oa%:ldmfd r13!,{r4-r8,pc}:.Fa stmfd r13!,{r14}:swi "XAWRender_FileInitAddress"
  275. str r0,Fa%:ldr r0,La%:mov r12,r1:adr r1,Ua:ldr r2,Ma%:adr r14,Ya:ldr pc,Fa%:.Ya swivs "OS_GenerateError":str r0,Ma%:ldmfd r13!,{pc}:.Ga stmfd r13!,{r14}:swi "XAWRender_RenderAddress":str r0,Ga%:ldr r0,Na%:mov r12,r1
  276. adr r1,Ha%:adr r2,Ia%:adr r3,Ja%:ldr r4,La%:adr r5,Ua:ldr r6,Ka%:mov r7,#0:adr r14,Za:ldr pc,Ga%:.Za swivs "OS_GenerateError":ldmfd r13!,{pc}:.aa stmfd r13!,{r14}:ldr r0,Na%:swi "XAWRender_DocBounds":str r2,Pa%:str r3,Qa%
  277. /str r4,Ra%:str r5,Sa%:ldmfd r13!,{pc}:]:
  278. ba (ca%):
  279. da% ca%,ea%&100:E%=da%+ca%:
  280. 262361,,h_$+".templates":
  281. 262363,,H_%,da%,E%,-1,"info",0
  282. ,,R%:
  283. 262337,,H_%
  284. 262363,,H_%,R%,E%,-1,"file",0
  285. ,,R%:
  286. 262337,,H_%
  287. 262363,,H_%,R%,E%,-1,"text",0
  288. 262337,,H_%
  289. 262363,,H_%,R%,E%,-1,"pic",0
  290. ,,R%:
  291. 262337,,H_%
  292. 262362:!E_%=Z`%:E_%!4=1:
  293. 262350,,E_%:$(E_%!28)=fa$:!E_%=Z`%:E_%!4=2:
  294. 262350,,E_%:$(E_%!28)=ga$:!E_%=Z`%:E_%!4=3:
  295. 262350,,E_%:$(E_%!28)=ha$
  296. E!E_%=K_%:E_%!4=0:
  297. 262350,,E_%:J%=E_%+8:
  298. 32:C`%!I%=J%!I%:
  299. 262336,200,&4B534154,"CDview"
  300. ia%,n`%:
  301. ia%<300
  302. 0,"This program requires RISC-OS 3 or better":
  303. E_%&180,L_%&100,m`% 24,R_%&100,f_% 15:
  304. C`%&28,E`%&60,z_%&B000:$m`%="CDview":
  305. $+" During initialisation",
  306. -&8000:H_%=
  307. 35,"CDview$Dir",E_%,256,0,3
  308. ,,I%:E_%?I%=13:h_$=$E_%:
  309. T_(&1000)=
  310. H`(1,"Not enough memory available to run !CDview"):
  311. ba(&400):
  312. G`:n_%=
  313. f`("CDview",-1,J`$):
  314. R`:I%=
  315. T_(0):
  316. ja:$E`%="Ssmall_dir":$(E`%+16)="Ssmall_FFF":$(E`%+32)="Ssmall_FF9":$(E`%+48)="Ssmall_AFF":$(E`%+64)="Ssmall_D94":$(E`%+80)="Ssmall_FF9":fa$="CDview v0.13":ga$="David Holden":ha$="
  317.  A.P.D.L. 1995":D_%=%110000110001:F`%=-550
  318. ka%&300,la 24,ma% 13,na% 15,oa% 255:
  319. pa:qa%=
  320. g_(ra$):
  321. "Closearchive cd_dir_arc":
  322. 5,"openarchive "+$R_%+" cd_dir_arc":ra$="arcfs#cd_dir_arc:$."+$f_%:M`%=
  323. 8,17,ra$
  324. F%,,,,I_%:
  325. 1)<>1
  326. 100,"File not found.":
  327. T_(I_%+20)=
  328. H`(1,"Not enough memory available to load this file"):
  329. "Closearchive cd_dir_arc":M`%=
  330. :!z_%=G_%:
  331. 262348,,z_%:$(z_%!76)=$f_%:
  332. 8,16,ra$,H_%,0:
  333. "Closearchive cd_dir_arc":M`%=
  334. H_%!I_%=&0A0A0A0A:A%=2:B%=H_%:C%=I_%:sa%=
  335. (J_%):!E_%=0:E_%!4=-sa%:E_%!8=1232:E_%!12=0:
  336. 262359,G_%,E_%:!E_%=G_%:
  337. 262347,,E_%:E_%!20=0:E_%!24=0:E_%!28=-1:
  338. 262341,,E_%:
  339. __(ta%,ua$):
  340. va%,wa%,xa%,L`%:
  341. ya%,g`%,za%:
  342. "Closearchive cd_dir_arc":
  343.  Get file length
  344. 5,"openarchive "+$R_%+" cd_dir_arc":ua$="arcfs#cd_dir_arc:$."+$f_%:M`%=
  345. 8,5,ua$
  346. ,,L`%,,I_%:L`%=(L`%>>8)
  347. &FFF:
  348. L`%=&3FB
  349. 5,"openarchive "+ua$+" cd_dir_arc":ua$="arcfs#cd_dir_arc:$."+$f_%:M`%=
  350. 8,5,ua$
  351. ,,,,I_%
  352. :!z_%=U_%:
  353. 262348,,z_%:
  354.  If window has an icon, delete it
  355. z_%!88>0
  356. ,!E_%=U_%:E_%!4=0:
  357. 262340,,E_%:I%=
  358. T_(0)
  359.  Get size of window
  360. Iva%=z_%!12-z_%!4:wa%=z_%!16-z_%!8:
  361.  Calculate space needed for sprite
  362. Lxa%=
  363. _a(va%,
  364. ,ya%):
  365.  Grab space, initialise sprite area(s) and load file
  366. T_(ya%+I_%+8)=0 I%=
  367. H`(1,"Not enough memory available to load this file"):
  368. /g`%=H_%:za%=g`%+ya%:
  369. `a(g`%,ya%):
  370. ta%=&FF9
  371. `a(za%,I_%+8):
  372. 46,10+256,za%,ua$
  373. 8,255,ua$,za%
  374. "Closearchive cd_dir_arc":M`%=
  375.  Make the sprite
  376. Ab(ta%,za%,I_%,$f_%,g`%,xa%,
  377. Bb(g`%,
  378.  Add the sprite to the window
  379. !E_%=U_%:E_%!4=0:E_%!12=va%:E_%!8=-va%:E_%!16=0:E_%!20=&0700A11A:E_%!24=f_%:E_%!28=g`%:E_%!32=
  380. ($f_%):
  381. 262338,,E_%:
  382.  Open the window
  383. c!E_%=U_%:
  384. 262347,,E_%:E_%!28=-1:
  385. 262341,,E_%:
  386. 262353,-1,E_%!4,E_%!8,E_%!4+va%,E_%!8+va%+40:
  387. Ab(ta%,Cb%,Db%,Eb$,Fb%,Gb%,Hb%):
  388. r0%,r1%,r2%,r3%:
  389. Ib%,Jb%,I%:
  390. Kb%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%:
  391. Rb(Hb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%):
  392. Kb%>=63 Ib%=0
  393. Ib%=1
  394.  Create a sprite
  395. 131118,15+256,Fb%,Eb$,Ib%,Gb%
  396. Mb%,Gb%
  397. Ob%,Hb%:
  398.  Divert output to it
  399. 'g!ka%=0:
  400. 131118,60+256,Fb%,Eb$,ka%
  401. r0%,r1%,r2%,r3%:
  402. 46,r0%,r1%,r2%,r3%:I%=
  403. T_(0):
  404.  Give the sprite a palette (if less than 63 colours)
  405. 131118,24+256,Fb%,Eb$
  406. ,,Jb%:
  407. 4:Jb%!(44+I%*2)=Sb%!I%:Jb%!(44+I%*2+4)=Sb%!I%:
  408. 4:Jb%!(44+I%*2)=Tb%!I%:Jb%!(44+I%*2+4)=Tb%!I%:
  409. 4:Jb%!(44+I%*2)=Ub%!I%:Jb%!(44+I%*2+4)=Ub%!I%:
  410. 264016:
  411.  Make white background
  412. Vb(&FFFFFF00):
  413. 0,0,Gb%:
  414.  Call appropriate sub-routine
  415. &FF9:
  416. Wb(Cb%,1,Hb%,0,0,Gb%,Gb%)
  417. &AFF,&CC3:
  418. Xb(Cb%,Gb%,Db%)
  419. &D94:
  420. Yb(Cb%,Gb%,Db%)
  421.  Restore output back to screen
  422. 46,r0%,r1%,r2%,r3%:
  423. 264016:
  424. H`(1,"Unable to display this Artworks file."):qa%=
  425. Wb(Zb%,ab%,Hb%,bb%,cb%,db%,eb%):
  426. fb%,gb%,hb%,Kb%,Lb%,ib%,Nb%,jb%,Pb%,Qb%,Mb%,Ob%:
  427. kb,lb,mb,nb,ob,pb,qb%:
  428. rb%,sb%,tb%,ub%,vb%:
  429. 46,13+256,Zb%,ma%,13,ab%:
  430. 131118,40+256,Zb%,ma%
  431. ,,,fb%,gb%,,hb%
  432. Rb(hb%,tb%,Lb%,ib%,Nb%,jb%,Pb%,Qb%):kb=fb%*ib%:na%!0=ib%*256:lb=gb%*jb%:na%!4=jb%*256:
  433. kb<>0
  434. lb<>0
  435. U*mb=db%/kb:nb=eb%/lb:
  436. mb<nb nb=mb
  437. mb=nb
  438. Rb(Hb%,ub%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%):
  439. mb<>0 na%!8=Mb%*256/mb
  440. nb<>0 na%!12=Ob%*256/nb
  441. 46,24+256,Zb%,ma%
  442. ,,qb%:
  443. qb%!32<>44
  444. qb%!32-52
  445. 8:wb%!(I%/2)=qb%!(I%+44):
  446. :rb%=wb%
  447. 15:rb%=Sb%
  448. 3:rb%=Tb%
  449. 1:rb%=Ub%
  450. :rb%=0
  451. 15:sb%=Sb%
  452. 3:sb%=Tb%
  453. 1:sb%=Ub%
  454. :sb%=0
  455. tb%>255
  456. p    vb%=0
  457. :vb%=oa%:
  458. qb%!32<>44+2048
  459. 264000,hb%,rb%,Hb%,sb%,oa%
  460. 264006,rb%!(Q%<<2),Hb%,sb%
  461. oa%?Q%:
  462. :ob=(db%-mb*kb)/2+bb%:pb=(eb%-nb*lb)/2+cb%:
  463. 46,52+256,Zb%,ma%,ob,pb,8,na%,vb%
  464. Xb(Cb%,Gb%,Db%):
  465. kb,lb,mb,nb,ob,pb:
  466.  not Points%
  467. jxb=Cb%!24:yb=Cb%!28:zb=Cb%!32:_b=Cb%!36:kb=(zb-xb)
  468. 256:lb=(_b-yb)
  469. 256:`b%=xb
  470. 256:Ac%=yb
  471. kb=0 kb=1
  472. lb=0 lb=1
  473. *mb=Gb%/kb:nb=Gb%/lb:
  474. mb<nb nb=mb
  475. mb=nb
  476. Bc=mb:ob=(Gb%-mb*kb)/2:pb=(Gb%-nb*lb)/2:Cc=&10000*Bc:Dc=Cc/&10000:la!0=Cc:la!4=0:la!8=0:la!12=Cc:la!16=ob*&100-xb*Dc:la!20=pb*&100-yb*Dc:
  477. 415040,0,Cb%,Db%,la,0:
  478. Yb(Ec%,Gb%,I_%):
  479. Ec%!4>10
  480. !La%=Ec%:!Ma%=I_%:!Na%=-1:!Oa%=I_%:
  481. Fa:!Na%=!La%:!Oa%=!Ma%:!La%=!Na%+!Oa%:!Ma%=0:
  482. aa:!Ha%=0:Ha%!4=0:Ha%!8=!Pa%:Ha%!12=!Qa%:Ha%!16=!Ra%:Ha%!20=!Sa%:kb=!Ra%-!Pa%:lb=!Sa%-!Qa%:
  483. kb=0 kb=1
  484. lb=0 lb=1
  485. %mb=Gb%*256/kb:
  486. mb>=&7FFF
  487. mb=&7FFF
  488. %nb=Gb%*256/lb:
  489. nb>=&7FFF
  490. nb=&7FFF
  491. mb<nb nb=mb
  492. mb=nb
  493. !Ia%=&10000*mb:Ia%!4=0:Ia%!8=0:Ia%!12=&10000*mb:Ia%!16=(Gb%*256-kb*mb)/2-!Pa%*mb:Ia%!20=(Gb%*256-lb*mb)/2-!Qa%*mb:
  494. ,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%):!Ja%=Lb%:Ja%!4=Nb%:Ja%!8=Pb%:
  495. 1:Fc%=Gc%
  496. 3:Fc%=Hc%
  497. 15:Fc%=Ic%
  498. :Fc%=Jc%
  499. 4:!(Ja%+12+I%)=Fc%!I%:
  500. :!Ka%=110:
  501. 263872:
  502. 263874:
  503. _a(Kc%,Lc%,
  504. Mc%):
  505. Kb%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%:
  506.  X OS Units Per Word
  507. Rb(Lc%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%,Qb%):Nc%=Mb%*8/Qb%*4:
  508. Nc%<>0
  509. Kc%=((Kc%
  510. Nc%)+1)*Nc%
  511. :Mc%=((Kc%/Mb%*Kc%/Ob%)*Qb%/8-(Qb%=8)*512+256):
  512. Lc%=2
  513. Lc%=4
  514. Lc%=5
  515. Lc%=10
  516. Mc%=Mc%*2
  517. Bb(Oc%,Lc%):
  518. Cb%,J%,I%:
  519. 53,Lc%,3
  520. ,,Kb%:Cb%=Oc%+Oc%!8:
  521. Oc%!4:
  522. 4:Cb%!(44+I%*2)=Sb%!I%:Cb%!(44+I%*2+4)=Sb%!I%:
  523. 4:Cb%!(44+I%*2)=Tb%!I%:Cb%!(44+I%*2+4)=Tb%!I%:
  524. 4:Cb%!(44+I%*2)=Ub%!I%:Cb%!(44+I%*2+4)=Ub%!I%:
  525. :Cb%+=!Cb%:
  526. `a(S%,Db%):!S%=Db%:S%!8=16:
  527. 46,9+256,S%:
  528. Rb(Lc%,
  529. Qb%):
  530. 53,Lc%,3
  531. ,,Qc%:
  532. 53,Lc%,4
  533. ,,Lb%:Mb%=1<<Lb%:
  534. 53,Lc%,5
  535. ,,Nb%:Ob%=1<<Nb%:
  536. 53,Lc%,9
  537. ,,Pb%:Qb%=1<<Pb%:
  538. Vb(Rc):
  539. 264005,Rc,
  540. 3)<<6
  541. Tc(Uc%):
  542. c%,p%:
  543. 53,Uc%,3
  544. ,,c%:
  545. 15:p%=Sb%
  546. 3:p%=Tb%
  547. 1:p%=Ub%
  548. :p%=0
  549. 256(m%):
  550. 53,m%,3
  551. ,,c%:=(c%>=63)
  552. Sb% 80,Tb% 80,Ub% 80,Vc% 320,wb% 1023:
  553. 8,255,h_$+".Pal16",Sb%:
  554. 8,255,h_$+".WimpPals",Vc%:Gc%=Vc%:Hc%=Gc%+80:Ic%=Hc%+80:Jc%=Ic%+80:
  555. 1:Ub%!(4*(1-I%))=(&FFFFFF*I%)<<8:
  556. 3:Tb%!(4*(3-I%))=(&555555*I%)<<8:
  557.